package com.dc.controller;

import com.dc.base.pojo.BaseModel;
import com.dc.service.SysUserService;
import com.wordnik.swagger.annotations.ApiImplicitParam;
import com.wordnik.swagger.annotations.ApiImplicitParams;
import com.wordnik.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/user")
public class SysUserController {
    @Autowired private SysUserService userService;

    @RequestMapping("/selectUserAll")
    @ResponseBody

    @ApiOperation(value="查询所有的用户信息",notes ="查询",httpMethod = "GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page",value ="当前页码",defaultValue = "1"
                    ,dataType = "Integer",paramType = "query"),
            @ApiImplicitParam(name = "maxSize",value ="当前页最大条数"
                    ,dataType = "Integer",defaultValue = "10",paramType = "query")})
    //required 是否必填，defaultValue = "1"设置默认值，@RequestParam中也包含这个两个属性
    public BaseModel selectUserAll(@RequestParam(value="page",defaultValue ="1")Integer page
            ,@RequestParam(value="page",defaultValue ="10") Integer maxSize){
        BaseModel baseModel=userService.selectUserAll(page,maxSize);
        return baseModel;
    }
}
